package cn.mybatis.service;

import cn.mybatis.dao.UserDao;
import cn.mybatis.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import javax.inject.Inject;
import javax.inject.Named;

/**
 * @author zhang peng yang ming
 * @create 2018-07-30 22:03
 */
@Scope("prototype")
@Service
public class UserService {
//    @Inject
//    @Named("mysqlUserDao")
    private UserDao userDao;

    @Inject
    public void setUserDao(@Named("mysqlUserDao")UserDao userDao) {
        this.userDao = userDao;
    }
    public User findByUsername(String username) {
        return userDao.findByUsername(username);
    }
}
